home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 51
/
Amiga Format CD51 (2000-03-10)(Future Publishing)(GB)[!][issue 2000-04].iso
/
-in_the_mag-
/
pdselect
/
awnp
/
awnp-docs
/
demos
/
dropbox.rx
< prev
next >
Wrap
Text File
|
2000-02-16
|
4KB
|
186 lines
/*
App Icon and Pattern Match demo for AWNPipe
William H.M Parker 29 Jun 1999
*/
if ~show('L','rexxsupport.library') then
if ~addlib('rexxsupport.library',0,-30,0) then
exit(20)
parse source . . called .
call readtool()
call buildgui
do while ~eof(ca)
parse value readln(ca) with in ' ' in1
if in='app' then call typecheck()
end
call cleanup
exit
runit:
if tool.i='drawer' then call drawer()
else if tool.i='image' then call image()
else if tool.i='text' then call text()
else do
parse var tool.i t1 '%f' t2
address command run t1||in1||t2
end
if multi~=1 then return(1)
return(0)
typecheck:
do i=0 for pfh
call writeln(p.i,in1)
match=readln(p.i)
if match then if runit() then return
end /*for pfh*/
if((right(in1,1)~=':')&(right(in1,1)~='/')&(pos(':',in1)>0)) then do
do i=0 for bfh
call open(sin,in1)
call writeln(b.i,c2x(readch(sin,12)))
call close(sin)
match=readln(b.i)
if match then if runit() then return
end
end /*for bfh*/
return
image:
call open(ca1,"awnpipe:1/xc")
call writeln(ca1,'title "'in1'" defg ig ')
call readln(ca1)
call writeln(ca1,'bitmap fn "'strip(in1)'"')
parse value readln(ca1) with . wi hi
if wi<200 & hi <200 then do
call writeln(ca1,"image")
call readln(ca1);
end
else do
/*browser node images have problems if taler then 255 so split the image up*/
call writeln(ca1,'listbrowser arrows minw 200 minh 200')
call readln(ca1)
fntxt='fn ""'
mhi=0
do while mhi<hi-200
call writeln(ca1,'bitmap trans 'fntxt' anim 0|'mhi'|'wi'|200|0|0|0')
call readln(ca1)
call writeln(ca1,'browsernode gt ¶ ')
call readln(ca1)
mhi=mhi+200
fntxt=''
end
call writeln(ca1,'bitmap trans 'fntxt' anim 0|'mhi'|'wi'|'hi-mhi'|0|0|0')
call readln(ca1)
call writeln(ca1,'browsernode gt ¶ ')
call readln(ca1)
end
call writeln(ca1,"open")
call close(ca1)
return
text:
call open(ca1,"awnpipe:1/xc")
call writeln(ca1,'"'in1'" defg ig q ')
call writeln(ca1,"layout minw 400 minh 200 b 0")
call writeln(ca1,'textfield arrows gt 0 bd ro b 0 datain "'strip(in1)'"')
call writeln(ca1,"le")
call writeln(ca1,"open")
call close(ca1)
return
drawer:
call open(ca1,"awnpipe:1/xc")
call writeln(ca1,'"'in1'" defg ig q ')
call writeln(ca1,'listbrowser ro lbl "Name|Size|Date|Time|Protection|Key|Path" arrows minw 400 minh 200 st')
address command 'c:list >awnpipe:2/f "'strip(in1)'" lformat "browsernode gt *"%n|%l|%d|%t|%a|%k|%s%s*" "'
call open(ca2,"awnpipe:2")
lst=readch(ca2,65000)
call close(ca2)
call writeln(ca1,lst)
call writeln(ca1,"open")
close(ca1)
return
buildgui:
call open(ca,"awnpipe://xc")
call writeln(ca,'"DropViewer" app ig q db dg cg a ii "'called'" it ACTIVE m')
call writeln(ca,"layout s1 so cj b 0")
call writeln(ca,'label gt " Drop file or drawer icons *n here to view . "')
call writeln(ca,"le")
call writeln(ca,"open")
if iconify=1 then call writeln(ca,"id 0 s 32")
call writeln(ca,"m")
return
readtool:
pfh=0
bfh=0
p.pfh='p'||pfh
b.bfh='b'||bfh
open(tt,'awnpipe:/xi'called)
call readln(tt)
call readln(tt)
call readln(tt)
do while ~eof(tt)
in=readln(tt)
parse var in in0 ' ' in1 '=' in2
if in0='multi' then multi=1
if in0='iconify' then iconify=1
if in0='pat' then do
tool.pfh=in2
call open(p.pfh,'awnpipe:/xm')
call writeln(p.pfh,in1)
in=readln(p.pfh)
if in='ok' then do
/*say in 'bad pattern !'*/
end
else do
pfh=pfh+1
p.pfh='p'||pfh
end
end
if in0='bin' then do
btool.bfh=in2
call open(b.bfh,'awnpipe:/xm')
call tohex()
call writeln(b.bfh,in1)
in=readln(b.bfh)
if in='ok' then do
/*say in 'bad pattern !'*/
end
else do
bfh=bfh+1
b.bfh='b'||bfh
end
end
end
return
cleanup:
call close(ca)
do i=0 for pfh
call close(p.i)
end
do i=0 for bfh
call close(b.i)
end
return
tohex:
hin=in1
hout=''
do while hin~=''
t=left(hin,1)
hin=substr(hin,2)
if t='?' then hout=hout||'??'
else hout=hout||c2x(t)
end
in1=hout
return